package day07;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.nio.charset.StandardCharsets;

/**
 * @author zouran
 * createDate：2024/7/3  20:49
 */
public class ClientTest {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("127.0.0.1", 5678);
        sendTxt(socket);
    }

    public static void sendTxt(Socket socket) throws IOException {
        OutputStream out = socket.getOutputStream();
        out.write("你好\n你好".getBytes(StandardCharsets.UTF_8));
        socket.shutdownOutput();
        socket.close();
    }
}
